package org.jeecg.modules.veterans.service.impl;

import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.system.util.SecurityUtil;
import org.jeecg.modules.veterans.entity.SysCollectRecord;
import org.jeecg.modules.veterans.mapper.SysCollectRecordMapper;
import org.jeecg.modules.veterans.service.ISysCollectRecordService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.Date;
/**
 * @Description: 收藏记录表
 * @Author: jeecg-boot
 * @Date:   2022-07-08
 * @Version: V1.0
 */
@Service
public class SysCollectRecordServiceImpl extends ServiceImpl<SysCollectRecordMapper, SysCollectRecord> implements ISysCollectRecordService {
    @Override
    public boolean saveByOne(SysCollectRecord record){
        LoginUser loginUser = SecurityUtil.getLoginUser();
        record.setName(loginUser.getUsername());
        record.setUserId(loginUser.getId());
        record.setCollect("1");
        record.setCollectTime(new Date());
        return save(record);
    }
}
